package me.zhengjie.modules.hanzi.domain;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

@Data
@TableName("hanzi_user_progress")
public class UserProgress {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    private Long userId;
    private String character;
    private String status;
    private LocalDateTime learnTime;
    private Integer daysStreak;
    
    // 添加显示时间的方法
    public String getDisplayTime() {
        LocalDateTime now = LocalDateTime.now();
        if (learnTime.toLocalDate().equals(now.toLocalDate())) {
            return "今天 " + learnTime.format(DateTimeFormatter.ofPattern("HH:mm"));
        }
        return learnTime.format(DateTimeFormatter.ofPattern("MM-dd HH:mm"));
    }
} 